package com.iplant.pdm.service.po.bop.partpoint;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.DBJoin;
import com.iplant.pdm.service.basicenum.fpc.FPCStandardType;

import java.io.Serializable;

/**
 * 工艺工序-终检项点配置
 *
 * @author YouWang·Peng
 * 2023-9-25 10:19:46
 */
@DBBasePO(TableName = "fpc_final_check_item", CheckName = {"Code", "RouteID,RoutePartID,RoutePartPointID,WorkContent"},
        CodeAuto = true, CodePrefix = "FFCI-", CodeNum = 4, Schemas = DBSchemas.PDM)
public class FPCFinalCheckItem extends BasePO implements Serializable {
    /**
     * 序列号
     */
    private static final long serialVersionUID = 1L;

    @DBCondition
    @DBField
    public int RouteID = 0;//工艺路线ID
    @DBJoin(name = "Code", tableName = "fpc_route", tableAsName = "route1", Schemas = DBSchemas.PDM,
            MainTableField = "RouteID")
    public String RouteCode = "";//工艺路线编码
    @DBJoin(name = "Version", tableName = "fpc_route", tableAsName = "route1", Schemas = DBSchemas.PDM,
            MainTableField = "RouteID")
    public String RouteVersion = "";//工艺路线版本

    @DBCondition
    @DBField
    public int RoutePartID = 0; // 工艺集ID
    @DBJoin(name = "Name", tableName = "fpc_routepart", tableAsName = "routepart1", Schemas = DBSchemas.PDM,
            MainTableField = "RoutePartID")
    public String RoutePartName = ""; // 工艺集名称
    @DBJoin(name = "Code", tableName = "fpc_routepart", tableAsName = "routepart1", Schemas = DBSchemas.PDM,
            MainTableField = "RoutePartID")
    public String RoutePartCode = ""; // 工艺集编码

    @DBCondition
    @DBField
    public int RoutePartPointID = 0; // 工艺工序ID
    @DBJoin(name = "Name", tableName = "fpc_routepartpoint", tableAsName = "routepartpoint1", Schemas = DBSchemas.PDM,
            MainTableField = "RoutePartPointID")
    public String RoutePartPointName = ""; // 工艺工序名称
    @DBJoin(name = "Code", tableName = "fpc_routepartpoint", tableAsName = "routepartpoint1", Schemas = DBSchemas.PDM,
            MainTableField = "RoutePartPointID")
    public String RoutePartPointCode = ""; // 工艺工序编码

    /**
     * 项点顺序
     */
    @DBField
    public int StepOrder = 0;
    /**
     * 工时
     */
    @DBField
    public double WorkTime = 0.0;
    /**
     * 作业指导书（支持多个）
     */
    @DBField
    public String InstructionsUrls = "";
    /**
     * 作业内容
     */
    @DBField
    public String WorkContent = "";
    /**
     * 作业要求
     */
    @DBField
    public String WorkRequirements = "";
    /**
     * 检验标准
     */
    @DBField
    public String CheckStandard = "";
    /**
     * 作业人数
     */
    @DBField
    public int PersonNumber = 0;

    /**
     * 产品参数（质量/工艺）
     */
    @DBField
    public int ProductParameter = 0;

    /**
     * 标准类型
     */
    @DBJoin(name = "StandardType", tableName = "fpc_product_parameter", tableAsName = "fpc_product_parameter1",
            Schemas = DBSchemas.PDM,
            MainTableField = "ProductParameter")
    public int StandardType = 0;
    /**
     * 标准类型文本
     */
    public String StandardTypeText = "";
    /**
     * 标准值
     */
    @DBJoin(name = "StandardValue", tableName = "fpc_product_parameter", tableAsName = "fpc_product_parameter1",
            Schemas = DBSchemas.PDM,
            MainTableField = "ProductParameter")
    public String StandardValue = "";
    /**
     * 基准值
     */
    @DBJoin(name = "StandardBasic", tableName = "fpc_product_parameter", tableAsName = "fpc_product_parameter1",
            Schemas = DBSchemas.PDM,
            MainTableField = "ProductParameter")
    public String StandardBasic = "";
    /**
     * 默认值
     */
    @DBJoin(name = "DefaultValue", tableName = "fpc_product_parameter", tableAsName = "fpc_product_parameter1",
            Schemas = DBSchemas.PDM,
            MainTableField = "ProductParameter")
    public String DefaultValue = "";
    /**
     * 下限值
     */
    @DBJoin(name = "StandardLeft", tableName = "fpc_product_parameter", tableAsName = "fpc_product_parameter1",
            Schemas = DBSchemas.PDM,
            MainTableField = "ProductParameter")
    public double StandardLeft = 0.0;
    /**
     * 上限值
     */
    @DBJoin(name = "StandardRight", tableName = "fpc_product_parameter", tableAsName = "fpc_product_parameter1",
            Schemas = DBSchemas.PDM,
            MainTableField = "ProductParameter")
    public double StandardRight = 0.0;
    /**
     * 是否必填
     */
    @DBField
    public int IsRequired = 0;

    @JsonProperty("RouteID")
    public int getRouteID() {
        return RouteID;
    }

    public void setRouteID(int routeID) {
        RouteID = routeID;
    }

    @JsonProperty("RouteCode")
    public String getRouteCode() {
        return RouteCode;
    }

    public void setRouteCode(String routeCode) {
        RouteCode = routeCode;
    }

    @JsonProperty("RouteVersion")
    public String getRouteVersion() {
        return RouteVersion;
    }

    public void setRouteVersion(String routeVersion) {
        RouteVersion = routeVersion;
    }

    @JsonProperty("RoutePartID")
    public int getRoutePartID() {
        return RoutePartID;
    }

    public void setRoutePartID(int routePartID) {
        RoutePartID = routePartID;
    }

    @JsonProperty("RoutePartName")
    public String getRoutePartName() {
        return RoutePartName;
    }

    public void setRoutePartName(String routePartName) {
        RoutePartName = routePartName;
    }

    @JsonProperty("RoutePartCode")
    public String getRoutePartCode() {
        return RoutePartCode;
    }

    public void setRoutePartCode(String routePartCode) {
        RoutePartCode = routePartCode;
    }

    @JsonProperty("RoutePartPointID")
    public int getRoutePartPointID() {
        return RoutePartPointID;
    }

    public void setRoutePartPointID(int routePartPointID) {
        RoutePartPointID = routePartPointID;
    }

    @JsonProperty("RoutePartPointName")
    public String getRoutePartPointName() {
        return RoutePartPointName;
    }

    public void setRoutePartPointName(String routePartPointName) {
        RoutePartPointName = routePartPointName;
    }

    @JsonProperty("RoutePartPointCode")
    public String getRoutePartPointCode() {
        return RoutePartPointCode;
    }

    public void setRoutePartPointCode(String routePartPointCode) {
        RoutePartPointCode = routePartPointCode;
    }

    @JsonProperty("StepOrder")
    public int getStepOrder() {
        return StepOrder;
    }

    public void setStepOrder(int stepOrder) {
        StepOrder = stepOrder;
    }

    @JsonProperty("WorkTime")
    public double getWorkTime() {
        return WorkTime;
    }

    public void setWorkTime(double workTime) {
        WorkTime = workTime;
    }

    @JsonProperty("InstructionsUrls")
    public String getInstructionsUrls() {
        return InstructionsUrls;
    }

    public void setInstructionsUrls(String instructionsUrls) {
        InstructionsUrls = instructionsUrls;
    }

    @JsonProperty("WorkContent")
    public String getWorkContent() {
        return WorkContent;
    }

    public void setWorkContent(String workContent) {
        WorkContent = workContent;
    }

    @JsonProperty("WorkRequirements")
    public String getWorkRequirements() {
        return WorkRequirements;
    }

    public void setWorkRequirements(String workRequirements) {
        WorkRequirements = workRequirements;
    }

    @JsonProperty("CheckStandard")
    public String getCheckStandard() {
        return CheckStandard;
    }

    public void setCheckStandard(String checkStandard) {
        CheckStandard = checkStandard;
    }

    @JsonProperty("PersonNumber")
    public int getPersonNumber() {
        return PersonNumber;
    }

    public void setPersonNumber(int personNumber) {
        PersonNumber = personNumber;
    }

    @JsonProperty("StandardType")
    public int getStandardType() {
        return StandardType;
    }

    public void setStandardType(int standardType) {
        StandardType = standardType;
    }

    @JsonProperty("StandardTypeText")
    public String getStandardTypeText() {
        StandardTypeText = FPCStandardType.getEnumType(StandardType).getLabel();
        return StandardTypeText;
    }

    public void setStandardTypeText(String standardTypeText) {
        StandardTypeText = standardTypeText;
    }

    @JsonProperty("StandardValue")
    public String getStandardValue() {
        return StandardValue;
    }

    public void setStandardValue(String standardValue) {
        StandardValue = standardValue;
    }

    @JsonProperty("StandardBasic")
    public String getStandardBasic() {
        return StandardBasic;
    }

    public void setStandardBasic(String standardBasic) {
        StandardBasic = standardBasic;
    }

    @JsonProperty("DefaultValue")
    public String getDefaultValue() {
        return DefaultValue;
    }

    public void setDefaultValue(String defaultValue) {
        DefaultValue = defaultValue;
    }

    @JsonProperty("StandardLeft")
    public double getStandardLeft() {
        return StandardLeft;
    }

    public void setStandardLeft(double standardLeft) {
        StandardLeft = standardLeft;
    }

    @JsonProperty("StandardRight")
    public double getStandardRight() {
        return StandardRight;
    }

    public void setStandardRight(double standardRight) {
        StandardRight = standardRight;
    }

    @JsonProperty("IsRequired")
    public int getIsRequired() {
        return IsRequired;
    }

    public void setIsRequired(int isRequired) {
        IsRequired = isRequired;
    }

    @JsonProperty("ProductParameter")
    public int getProductParameter() {
        return ProductParameter;
    }

    public void setProductParameter(int productParameter) {
        ProductParameter = productParameter;
    }
}
